<html>
	<body>
		<?php
			require_once '../../../Helpers/DbHelper.php';
			require_once '../../../Controllers/StudentController.php';
			//
			$c = new StudentController();
			$i = $_REQUEST['id'];
			//
			if(isset($_POST['delete']))
			{
				$c->delete($i);
				header("Location: ../../../index.php");
			}
			else if(isset($_POST['cancel']))
			{
				header("Location: ../view.php?id=$i");
			}
			$s = mysql_fetch_object($c->read($i));
		?>
		<?php
			require_once '../../Partials/Navigation.php';
			renderNavigation('../../../');
		?>
		<br />
		Delete Student?<br />
		ID: <?= $i ?> <br />
		Name: <?= $s->Name; ?> <br />
		Section: <?= $s->Section; ?> <br />
		Balance: <?= $s->Balance; ?> <br />
		<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
			<input type="hidden" name="id" value="<?= $i ?>" />
			<input type="submit" name="cancel" value="Cancel" />
			<input type="submit" name="delete" value="Delete" />
		</form>
	</body>
</html>